import java.util.Scanner;

import static java.lang.Math.pow;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: syyyy
 * Date: 2025-07-15
 * Time: 13:33
 */
public class demo1 {
    public static int Count(){
        int count=0;
        for (int i = 1; i <= 100; i++) {
            if(i%10==9){
                count++;
                if(i/10==9){
                    count++;
                }
            }
        }
        return count;
    }

    public static boolean IsPrime(int n){
        for (int i = 2; i <=n-1; i++) {
            if(n%i==0){
                return false;
            }
        }
        return true;
    }

    public static void drawX(int m){
        for (int i = 0; i < m; i++) {
            for(int j=0;j<m;j++){
                if(i==j||i+j==m-1){
                    System.out.print("*");
                }else{
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
    }

    public static void isNarcissisticNum(){
        for(int i=100;i<=999;i++){
            int a=i%10;
            int b=i%100/10;
            int c=i/100;
            if(pow(a,3)+pow(b,3)+pow(c,3)==i){
                System.out.println(i);
            }
        }
    }

    public static double Sum(){
        double sum=0;
        int m=1;
        for (int i = 1; i < 100; i++) {
            sum=sum+(double)m/i;
            m=m*(-1);
        }
        return sum;
    }

    public static int maxDivision(int a,int b){
        while(true){
            int r=a%b;
            if(r==0){
                return b;
            }else{
                a=b;
                b=r;
            }
        }
    }

    public static int OneCount(int num){
        int count=0;
        while(num!=0){
            num=num&(num-1);
            count++;
        }
        return count;
    }
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
//        //int n= scanner.nextInt();
//        int count=Count();
//        System.out.println(count);
//        System.out.println("******************************");
//        int n=scanner.nextInt();
//        boolean isPrime=IsPrime(n);
//        System.out.println(isPrime);
//        System.out.println("******************************");
//        int m= scanner.nextInt();
//        drawX(m);
//        System.out.println("******************************");
//        isNarcissisticNum();
//        System.out.println("******************************");
//        double sum=Sum();
//        System.out.println(sum);
//        System.out.println("*****************************");
//        int a=scanner.nextInt();
//        int b=scanner.nextInt();
//        int num=maxDivision(a,b);
//        System.out.println(num);
//        System.out.println("*****************************");
        int num2= scanner.nextInt();
        int count2=OneCount(num2);
        System.out.println(count2);


    }
}
